# -*- coding: utf-8 -*-
'''
@Date    : 2022/10/13 14:23
@Author  : Zhaozhengyun
@File    : myprocessor.py
@Desc    :调用imagededup（ahash，phash和dhash），ssim，md5和phashdup海量去重方法。
'''
import os
# import parser
import argparse

# 设置参数对象,简要设置为该程序要执行什么任务
parser = argparse.ArgumentParser("mission_name")
# 调用 add_argument() 方法添加参数
parser.add_argument('--ckpt', type=str, default="./weigths/jaad/best.pth", help="Path to model weigths")
# 使用 parse_args() 解析添加的参数
args = parser.parse_args()

def call(arg, *args, **kwargs):
    global img1_input, img2_input, input_type, load_folder, save_folder
    result = {}
    try:
        # 参数解析

        load_folder = arg["load_folder"]
        load_folder1 = os.listdir(load_folder)

        # threshold = arg["threshold"]
        result["load_save"] = load_folder
        result["load_save1"] = load_folder1
        # 选择算法
        return result
        # return {"msg": "检测失败", "code": -1}
    except:
        return {"msg": "检测失败", "code": -1}


if __name__ == '__main__':
    arg = {
        "load_folder": "./load_folder"
    }
    print(call(arg))
